#include "ComponentFactory.h"

#include "ComponentPosition.h"
#include "ComponentRenderable.h"
#include "ComponentTarget.h"
#include "ComponentScriptable.h"
#include "ComponentMovable.h"
#include "ComponentHarvestable.h"

/** @brief create
  *
  * @todo: document this function
  */
Component* ComponentFactory::create(std::string _name, ComponentArguments _cArgs)
{

Component* c=0;

if (_name.compare("Position")==0)
{
    c = new ComponentPosition(m_parent, _cArgs);
}

else if (_name.compare("Renderable")==0)
{
    c = new ComponentRenderable(m_parent, _cArgs);
}
else if (_name.compare("Scriptable")==0)
{
    c = new ComponentScriptable(m_parent, _cArgs);
}
else if (_name.compare("Movable")==0)
{
    c = new ComponentMovable(m_parent, _cArgs);
}
else if (_name.compare("Target")==0)
{
    c = new ComponentTarget(m_parent, _cArgs);
}
else if (_name.compare("Harvestable")==0)
{
    c = new ComponentHarvestable(m_parent, _cArgs);
}

return c;

}

/** @brief ComponentFactory
  *
  * @todo: document this function
  */
 ComponentFactory::ComponentFactory(ComponentManager* _parent):
 m_parent(_parent)
{

}

ComponentFactory::~ComponentFactory()
{


}
